using System.Collections;
using UnityEngine;

public class RODOCancelConsentSucessfully : MonoBehaviour, IOnEndAnimation, IBackAction
{
	private Animator anim;

	private UserPreferences userPreferences;

	private float waitSeconds = 1f;

	private void Awake()
	{
		anim = GetComponent<Animator>();
		userPreferences = UserPreferences.instance;
		Globals.instance.backManager.RegisterObject(this);
	}

	private void Start()
	{
		StartCoroutine(ShowRODO());
	}

	private IEnumerator ShowRODO()
	{
	//	userPreferences.playerData.RODOAccepted = false;
		userPreferences.Save();
		yield return new WaitForSeconds(waitSeconds);
		GameObject prefab = Resources.Load<GameObject>("RODO_Info");
		Object.Instantiate(prefab);
		anim.SetTrigger("Hide");
	}

	public void OnEndAnimation()
	{
		UnityEngine.Object.Destroy(base.gameObject);
	}

	public void OnBackAction()
	{
	}
}
